extends "../cTDR/cTDR.gd"
func _info():
	pass

func _connect():
	._connect()

func _extInit():
	._extInit()
	chaName = "装甲机"
	lv = 2
	attCoe.atkRan = 2
	attCoe.atk = 22 / 8.5 * 2 / 2
	attCoe.maxHp = 720 / 112.5 / 2
	addSkillTxt("机器人：攻击距离无限远[开始战斗生效]|普攻会额外发射两道穿甲箭，对直线上所有敌人造成20%物理伤害[可miss]")
var satk = 0.2

func _onBattleStart():
	._onBattleStart()
	self.addBuff(BF.new(1))

func _onNormalAtk(cha):
	._onNormalAtk(cha)
	var c = cha.cell
	var v = [Vector2(0,1),Vector2(0,-1)]
	if cha.cell.x == cell.x:
		v = [Vector2(1,0),Vector2(-1,0)]
	for i in v:
		if sys.main.isMatin(c + i):
			var pos = sys.main.map.map_to_world(c + i)
			var eff:Eff = newEff("sk_chuanTouJian",sprcPos)
			eff._initFlyPos(position + (pos - position).normalized() * 1000,800)
			eff.connect("onInCell",self,"effInCell")

func effInCell(cell):
	var cha = matCha(cell)
	if cha:
		if cha.team != self.team:
			hurtChara(cha,att.atk * satk)
class BF:
	extends Buff
	var canremove:bool = false
	func _init(lv):
		attInit()
		id = "JQR"
		att.atkRan = 15
